package com.equipmentRent.system.mapper;

import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.equipmentRent.system.domain.OrderDetail;
import org.apache.ibatis.annotations.Param;

/**
 * 订单明细Mapper接口
 * 
 * @author zxl
 * @date 2025-05-17
 */
public interface OrderDetailMapper extends BaseMapper<OrderDetail>

{
    /**
     * 查询订单明细
     * 
     * @param id 订单明细主键
     * @return 订单明细
     */
    public OrderDetail selectOrderDetailById(Long id);

    /**
     * 查询订单明细列表
     * 
     * @param orderDetail 订单明细
     * @return 订单明细集合
     */
    public List<OrderDetail> selectOrderDetailList(OrderDetail orderDetail);

    /**
     * 新增订单明细
     * 
     * @param orderDetail 订单明细
     * @return 结果
     */
    public int insertOrderDetail(OrderDetail orderDetail);

    /**
     * 修改订单明细
     * 
     * @param orderDetail 订单明细
     * @return 结果
     */
    public int updateOrderDetail(OrderDetail orderDetail);

    /**
     * 删除订单明细
     * 
     * @param id 订单明细主键
     * @return 结果
     */
    public int deleteOrderDetailById(Long id);

    /**
     * 批量删除订单明细
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrderDetailByIds(String[] ids);

    OrderDetail selectOrderDetailByOrderId(String orderId);

    List<OrderDetail> selectOrderDetailByOrderIdAndStatus(@Param("orderId") String orderId, @Param("status") long status);

    OrderDetail selectOrderDetailByOrderIdAndItemId(@Param("orderId") String orderId, @Param("itemId") Long itemId);
    OrderDetail selectOrderDetailByOrderIdAndItemIdByReturn(@Param("orderId") String orderId, @Param("itemId") Long itemId);

}
